;;; package-settings.el --- 安裝 package 的配置

(require 'package)
(add-to-list 'package-archives
	     '("melpa" . "http://melpa.milkbox.net/packages/") t)
(when (< emacs-major-version 24)
  ;; For important compatibility libraries like cl-lib
  (add-to-list 'package-archives '("gnu" . "http://elpa.gnu.org/packages/")))
(package-initialize)

(defconst my-packages
  '(company
    company-jedi
    flycheck
    yasnippet
    cmake-mode
    cpputils-cmake
    helm
    helm-gtags
    helm-company
    company-c-headers
    iedit
    autopair
    desktop))

(defun install-packages ()
  "Install all required packages."
  (interactive)
  (unless package-archive-contents
    (package-refresh-contents))
  (dolist (package my-packages)
    (unless (package-installed-p package)
      (package-install package))))

(install-packages)
